namespace JHT.EFMigrationTest.ClassLibrary1.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class AddStudentsDetails : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.StudentsDetails",
                c => new
                    {
                        Id = c.Long(nullable: false),
                        FamilyAddress = c.String(maxLength: 50, unicode: false),
                        ContactTelphoe = c.String(maxLength: 20, unicode: false),
                        BirthDate = c.DateTime(),
                        Height = c.Decimal(precision: 18, scale: 2),
                        Weight = c.Decimal(precision: 18, scale: 2),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.Students", t => t.Id)
                .Index(t => t.Id);
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.StudentsDetails", "Id", "dbo.Students");
            DropIndex("dbo.StudentsDetails", new[] { "Id" });
            DropTable("dbo.StudentsDetails");
        }
    }
}
